package com.simon.resourcestatistics.controller;

import java.util.List;

import javax.annotation.Resource;

import com.simon.resourcestatistics.dao.IStatisticsDao;
import com.simon.resourcestatistics.model.Statistics;
import com.simon.resourcestatistics.util.ChartUtil;
import com.simon.resourcestatistics.vo.RoomChartVO;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;


@RestController
@RequestMapping("/statistics")
public class StatisticsController {
 
    @Resource
    private IStatisticsDao statisticsDao;


    @ApiOperation(value = "资源室使用统计",notes = "资源室使用统计")
    @GetMapping
    public List<RoomChartVO> getVo(){
        List<Statistics> list =  statisticsDao.findAll();
        return ChartUtil.getChart(list);

    } 
}